package com.hollysys.hollimsa.biz.istio.enhanceservice.dao;

import io.fabric8.kubernetes.api.model.Service;
import io.fabric8.kubernetes.client.KubernetesClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author wangyuxi
 * @date 2020/11/08
 **/
@Component
public class EnhanceServiceDao {

    @Autowired
    private KubernetesClient kubernetesClient;

    public List<Service> getAllKubernetesServices(String namespace) {
        return kubernetesClient.services().inNamespace(namespace).list().getItems();
    }

}
